package com.xt.mvcpilot.data;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToOne;


import com.xt.core.data.BasicDBObject; 

/**
 * This class represents the base db object in application
 * 
 * @author Author:  txiao
 * @version Revision: 1.0, Date: 07.06.2011
 * 
 */
@MappedSuperclass
public abstract class AppBasicDBObject extends BasicDBObject {

	private static final long serialVersionUID = 1L;

	//construction
	public AppBasicDBObject(){
	
	}
	
	//generic attributes in the application
	@Column(name = "createdOn")
	private Date createdOn = new Date();
	
	@Override
	public int hashCode() {
		int result = super.hashCode();
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		return true;
	}

	public Date getCreatedOn() {
		return createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}
	
}
